/**
 * 
 */
package niuke;

import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 第K大的数 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		String line=scanner.nextLine();
		String[] nums=line.split(" ");
		int N=nums.length;
		int[] A=new int[N];
		for (int j = 0; j < N; j++) {
			A[j]=Integer.parseInt(nums[j]);
		}
		int K=scanner.nextInt();
		scanner.close();
		PriorityQueue<Integer> queue=new PriorityQueue<>(K);
		int i = 0;
		for ( ;i < K; i++) {
			queue.add(A[i]);
		}
		while (i<N) {
			if(A[i]>queue.peek()){
				queue.poll();
				queue.add(A[i]);
			}
			i++;
		}
		System.out.println(queue.peek());
	}
}
